<?php


namespace app\index\controller;


use app\admin\service\RbacService;
use app\common\controller\CommonController;
use app\common\exception\ParameterFailedException;
use app\common\exception\NotFoundException;
use app\common\middleware\AuthToken;
use app\common\model\BannerModel;
use app\common\service\Lang;
use app\common\validate\XXXXXValidate;
use think\facade\Db;
use think\Request;

class BannerController extends CommonController
{
    protected $middleware = [
        AuthToken::class => ['except' => ['getBannerList']],
    ];

    public function getBannerList(Request $request)
    {
        $models = (new BannerModel())->getBannerList();
        if ($models->isEmpty()) {
            $res = [];
        }
        else {
            $res = $models->toArray();
        }
        return retJson(Lang::GETDone, $res);
    }
}